﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;

namespace _10.FactorialOf100Numbers
{
    class FactorialOf100Numbers
    {
        public static void CalculateFactorial(ref BigInteger[] factorialArray, int currentNumber)
        {
            factorialArray[currentNumber] = factorialArray[currentNumber - 1] * (currentNumber + 1);
        }

        static void Main(string[] args)
        {
            Console.WriteLine("Input N:");
            int n = int.Parse(Console.ReadLine());
            BigInteger[] factorialArray = new BigInteger[n];
            factorialArray[0] = 1;
            for (int currentNumber = 1; currentNumber < n; currentNumber++)
            {
                CalculateFactorial(ref factorialArray, currentNumber);
            }

            for (int currentNumber = 0; currentNumber < factorialArray.Length; currentNumber++)
            {
                Console.Write(" {0}! = {1}", currentNumber + 1, factorialArray[currentNumber]);
                Console.WriteLine();
                Console.WriteLine();
            }
        }
    }
}